/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('nis', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateAndAnalyzeNetworkPathRequest {
  protocol?: string(name='Protocol', description='The protocol type. Valid values:

*   **tcp**: Transmission Control Protocol (TCP)
*   **udp**: User Datagram Protocol (UDP)
*   **icmp**: Internet Control Message Protocol (ICMP)', example='tcp'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to initiate a task for analyzing network reachability.', example='cn-shanghai'),
  sourceId?: string(name='SourceId', description='The ID of the source resource.

This parameter is required.', example='i-uf62y8khhbkbdrp6****'),
  sourceIpAddress?: string(name='SourceIpAddress', description='The source IP address.', example='192.168.XX.XX'),
  sourcePort?: int32(name='SourcePort', description='The source port.', example='0'),
  sourceType?: string(name='SourceType', description='The type of the source resource. Valid values:

*   **ecs**: the Elastic Compute Service (ECS) instance
*   **internetIp**: the public IP address
*   **vsw**: the vSwitch
*   **vpn**: the VPN gateway
*   **vbr**: the virtual border router (VBR)

This parameter is required.', example='ecs'),
  targetId?: string(name='TargetId', description='The ID of the destination resource.', example='i-m5eactvw7wtpktv5****'),
  targetIpAddress?: string(name='TargetIpAddress', description='The destination IP address.', example='172.50.XX.XX'),
  targetPort?: int32(name='TargetPort', description='The destination port.', example='80'),
  targetType?: string(name='TargetType', description='The type of the destination resource. Valid values:

*   **ecs**: the ECS instance
*   **internetIp**: the public IP address
*   **vsw**: the vSwitch
*   **vpn**: the VPN gateway
*   **vbr**: the VBR
*   **clb**: the Classic Load Balancer (CLB) instance', example='ecs'),
}

model CreateAndAnalyzeNetworkPathResponseBody = {
  networkReachableAnalysisId?: string(name='NetworkReachableAnalysisId', description='The ID of the task for analyzing network reachability that you initiated.', example='nra-dfe9e53d2b524568****'),
  protocol?: string(name='Protocol', description='The protocol type.', example='tcp'),
  requestId?: string(name='RequestId', description='The request ID.', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
  sourceId?: string(name='SourceId', description='The ID of the source resource.', example='i-uf62y8khhbkbdrp6****'),
  sourceIpAddress?: string(name='SourceIpAddress', description='The source IP address.', example='192.168.XX.XX'),
  sourcePort?: string(name='SourcePort', description='The source port.', example='0'),
  sourceType?: string(name='SourceType', description='The type of the source resource.', example='ecs'),
  targetId?: string(name='TargetId', description='The ID of the destination resource.', example='i-m5eactvw7wtpktv5****'),
  targetIpAddress?: string(name='TargetIpAddress', description='The destination IP address.', example='172.50.XX.XX'),
  targetPort?: string(name='TargetPort', description='The destination port.', example='80'),
  targetType?: string(name='TargetType', description='The type of the destination resource.', example='ecs'),
}

model CreateAndAnalyzeNetworkPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAndAnalyzeNetworkPathResponseBody(name='body'),
}

/**
 * @summary Initiates a task for analyzing network reachability.
 *
 * @description You can call this operation to initiate a task for analyzing network reachability by specifying only the information about the source and destination. You do not need to create a network path for reachability analysis. The analysis result is not recorded in the system. If you want to record the path parameters and analysis result in the Network Intelligence Service (NIS) console, we recommend that you call the **createNetworkReachableAnalysis** operation.
 *
 * @param request CreateAndAnalyzeNetworkPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAndAnalyzeNetworkPathResponse
 */
async function createAndAnalyzeNetworkPathWithOptions(request: CreateAndAnalyzeNetworkPathRequest, runtime: $RuntimeOptions): CreateAndAnalyzeNetworkPathResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAndAnalyzeNetworkPath',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates a task for analyzing network reachability.
 *
 * @description You can call this operation to initiate a task for analyzing network reachability by specifying only the information about the source and destination. You do not need to create a network path for reachability analysis. The analysis result is not recorded in the system. If you want to record the path parameters and analysis result in the Network Intelligence Service (NIS) console, we recommend that you call the **createNetworkReachableAnalysis** operation.
 *
 * @param request CreateAndAnalyzeNetworkPathRequest
 * @return CreateAndAnalyzeNetworkPathResponse
 */
async function createAndAnalyzeNetworkPath(request: CreateAndAnalyzeNetworkPathRequest): CreateAndAnalyzeNetworkPathResponse {
  var runtime = new $RuntimeOptions{};
  return createAndAnalyzeNetworkPathWithOptions(request, runtime);
}

model CreateNetworkPathRequest {
  networkPathDescription?: string(name='NetworkPathDescription', description='The description of the network path.', example='Analyze the path from ECS to ECS'),
  networkPathName?: string(name='NetworkPathName', description='The name of the network path.

This parameter is required.', example='ecs2PublicIp'),
  protocol?: string(name='Protocol', description='The protocol type. Valid values:

*   **tcp**: Transmission Control Protocol (TCP)
*   **udp**: User Datagram Protocol (UDP)
*   **icmp**: Internet Control Message Protocol (ICMP)', example='tcp'),
  regionId?: string(name='RegionId', description='The region ID of the network path that you want to create.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfm27qsxjj****'),
  sourceId?: string(name='SourceId', description='The ID of the source resource.

This parameter is required.', example='i-2zef4ngqfarepyun****'),
  sourceIpAddress?: string(name='SourceIpAddress', description='The source IP address.', example='172.17.XX.XX'),
  sourcePort?: int32(name='SourcePort', description='The source port.', example='443'),
  sourceType?: string(name='SourceType', description='The type of the source resource. Valid values:

*   **ecs**: the Elastic Compute Service (ECS) instance
*   **internetIp**: the public IP address
*   **vsw**: the vSwitch
*   **vpn**: the VPN gateway
*   **vbr**: the virtual border router (VBR)

This parameter is required.', example='ecs'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N to add to the resource. The tag key can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.

You can add up to 20 tags in each call.', example='role'),
      value?: string(name='Value', description='The value of tag N to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag value cannot start with `aliyun` or `acs:`.', example='ops'),
    }
  ](name='Tag', description='The tags to add to the resource.'),
  targetId?: string(name='TargetId', description='The ID of the destination resource.', example='i-bp13d0e064gubm****'),
  targetIpAddress?: string(name='TargetIpAddress', description='The destination IP address.', example='192.168.0.210'),
  targetPort?: int32(name='TargetPort', description='The destination port.', example='80'),
  targetType?: string(name='TargetType', description='The type of the destination resource. Valid values:

*   **ecs**: the ECS instance
*   **internetIp**: the public IP address
*   **vsw**: the vSwitch
*   **vpn**: the VPN gateway
*   **vbr**: the VBR
*   **clb**: the Classic Load Balancer (CLB) instance', example='ecs'),
}

model CreateNetworkPathResponseBody = {
  networkPathId?: string(name='NetworkPathId', description='The ID of the network path.', example='np-4cbf598673d14d27****'),
  requestId?: string(name='RequestId', description='The request ID.', example='92DD9FFB-06FB-56F7-83EF-5CEF98F5562A'),
}

model CreateNetworkPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNetworkPathResponseBody(name='body'),
}

/**
 * @summary Creates a network path in the cloud for reachability analysis.
 *
 * @description *   You can call the **CreateNetworkPath** operation to create network paths in multiple networking scenarios and between multiple resources. After a path is created, the path parameters are saved for repeated analysis.
 * *   You can create up to 100 network paths within one Alibaba Cloud account.
 *
 * @param request CreateNetworkPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNetworkPathResponse
 */
async function createNetworkPathWithOptions(request: CreateNetworkPathRequest, runtime: $RuntimeOptions): CreateNetworkPathResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.networkPathDescription)) {
    query['NetworkPathDescription'] = request.networkPathDescription;
  }
  if (!$isNull(request.networkPathName)) {
    query['NetworkPathName'] = request.networkPathName;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.sourceId)) {
    query['SourceId'] = request.sourceId;
  }
  if (!$isNull(request.sourceIpAddress)) {
    query['SourceIpAddress'] = request.sourceIpAddress;
  }
  if (!$isNull(request.sourcePort)) {
    query['SourcePort'] = request.sourcePort;
  }
  if (!$isNull(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.targetId)) {
    query['TargetId'] = request.targetId;
  }
  if (!$isNull(request.targetIpAddress)) {
    query['TargetIpAddress'] = request.targetIpAddress;
  }
  if (!$isNull(request.targetPort)) {
    query['TargetPort'] = request.targetPort;
  }
  if (!$isNull(request.targetType)) {
    query['TargetType'] = request.targetType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateNetworkPath',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a network path in the cloud for reachability analysis.
 *
 * @description *   You can call the **CreateNetworkPath** operation to create network paths in multiple networking scenarios and between multiple resources. After a path is created, the path parameters are saved for repeated analysis.
 * *   You can create up to 100 network paths within one Alibaba Cloud account.
 *
 * @param request CreateNetworkPathRequest
 * @return CreateNetworkPathResponse
 */
async function createNetworkPath(request: CreateNetworkPathRequest): CreateNetworkPathResponse {
  var runtime = new $RuntimeOptions{};
  return createNetworkPathWithOptions(request, runtime);
}

model CreateNetworkReachableAnalysisRequest {
  networkPathId?: string(name='NetworkPathId', description='The ID of the network path. You can call the [CreateNetworkPath](https://help.aliyun.com/document_detail/2366522.html) operation to obtain the ID of the network path.

This parameter is required.', example='np-b2f618ceb2c84057****'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to create a task for analyzing network reachability.', example='cn-shanghai'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag to add to the resource. The tag key can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag key cannot start with `acs:` or `aliyun`.

You can add up to 20 tags in each call.', example='Team'),
      value?: string(name='Value', description='The value of the tag to add to the resource. The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag value cannot start with `acs:` or `aliyun`. The tag value can be an empty string.

You can add up to 20 tag values in each call.', example='ops'),
    }
  ](name='Tag', description='The tags to add to the resource.'),
}

model CreateNetworkReachableAnalysisResponseBody = {
  networkReachableAnalysisId?: string(name='NetworkReachableAnalysisId', description='The ID of the task for analyzing network reachability.', example='nra-2fede05617494417****'),
  requestId?: string(name='RequestId', description='The request ID.', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
}

model CreateNetworkReachableAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNetworkReachableAnalysisResponseBody(name='body'),
}

/**
 * @summary Creates a task for analyzing network reachability.
 *
 * @description *   The **CreateNetworkReachableAnalysis** operation is used to create a task for analyzing the reachability of the network path that is created by calling the **CreateNetworkPath** operation and record the analysis results.
 * *   The **CreateNetworkReachableAnalysis** operation can be called to repeatedly analyze the reachability of a network path.
 * *   You can create up to 1,000 reachability analysis records within one Alibaba Cloud account.
 *
 * @param request CreateNetworkReachableAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNetworkReachableAnalysisResponse
 */
async function createNetworkReachableAnalysisWithOptions(request: CreateNetworkReachableAnalysisRequest, runtime: $RuntimeOptions): CreateNetworkReachableAnalysisResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.networkPathId)) {
    query['NetworkPathId'] = request.networkPathId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateNetworkReachableAnalysis',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a task for analyzing network reachability.
 *
 * @description *   The **CreateNetworkReachableAnalysis** operation is used to create a task for analyzing the reachability of the network path that is created by calling the **CreateNetworkPath** operation and record the analysis results.
 * *   The **CreateNetworkReachableAnalysis** operation can be called to repeatedly analyze the reachability of a network path.
 * *   You can create up to 1,000 reachability analysis records within one Alibaba Cloud account.
 *
 * @param request CreateNetworkReachableAnalysisRequest
 * @return CreateNetworkReachableAnalysisResponse
 */
async function createNetworkReachableAnalysis(request: CreateNetworkReachableAnalysisRequest): CreateNetworkReachableAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return createNetworkReachableAnalysisWithOptions(request, runtime);
}

model DeleteNetworkPathRequest {
  networkPathIds?: [ string ](name='NetworkPathIds', description='The IDs of network paths.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the network path that you want to delete.', example='cn-shanghai'),
}

model DeleteNetworkPathShrinkRequest {
  networkPathIdsShrink?: string(name='NetworkPathIds', description='The IDs of network paths.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The region ID of the network path that you want to delete.', example='cn-shanghai'),
}

model DeleteNetworkPathResponseBody = {
  data?: boolean(name='Data', description='Result of operation.

- **true**: Delete Success.
- **false**: Delete Fail.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='C4331873-C534-590F-A905-F66C53B88A47'),
}

model DeleteNetworkPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNetworkPathResponseBody(name='body'),
}

/**
 * @summary Deletes a network path.
 *
 * @param tmpReq DeleteNetworkPathRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNetworkPathResponse
 */
async function deleteNetworkPathWithOptions(tmpReq: DeleteNetworkPathRequest, runtime: $RuntimeOptions): DeleteNetworkPathResponse {
  tmpReq.validate();
  var request = new DeleteNetworkPathShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.networkPathIds)) {
    request.networkPathIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.networkPathIds, 'NetworkPathIds', 'json');
  }
  var query = {};
  if (!$isNull(request.networkPathIdsShrink)) {
    query['NetworkPathIds'] = request.networkPathIdsShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteNetworkPath',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a network path.
 *
 * @param request DeleteNetworkPathRequest
 * @return DeleteNetworkPathResponse
 */
async function deleteNetworkPath(request: DeleteNetworkPathRequest): DeleteNetworkPathResponse {
  var runtime = new $RuntimeOptions{};
  return deleteNetworkPathWithOptions(request, runtime);
}

model DeleteNetworkReachableAnalysisRequest {
  networkReachableAnalysisIds?: [ string ](name='NetworkReachableAnalysisIds', description='The IDs of the tasks for analyzing network reachability.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to delete a task for analyzing network reachability.', example='cn-shanghai'),
}

model DeleteNetworkReachableAnalysisShrinkRequest {
  networkReachableAnalysisIdsShrink?: string(name='NetworkReachableAnalysisIds', description='The IDs of the tasks for analyzing network reachability.

This parameter is required.'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to delete a task for analyzing network reachability.', example='cn-shanghai'),
}

model DeleteNetworkReachableAnalysisResponseBody = {
  data?: boolean(name='Data', description='Result of operation.
- **true**: Delete Success.
- **false**: Delete Fail.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='4838F3F2-30E1-5D82-B25A-B9FE33BC3E25'),
}

model DeleteNetworkReachableAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNetworkReachableAnalysisResponseBody(name='body'),
}

/**
 * @summary Deletes a task for analyzing network reachability.
 *
 * @param tmpReq DeleteNetworkReachableAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNetworkReachableAnalysisResponse
 */
async function deleteNetworkReachableAnalysisWithOptions(tmpReq: DeleteNetworkReachableAnalysisRequest, runtime: $RuntimeOptions): DeleteNetworkReachableAnalysisResponse {
  tmpReq.validate();
  var request = new DeleteNetworkReachableAnalysisShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.networkReachableAnalysisIds)) {
    request.networkReachableAnalysisIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.networkReachableAnalysisIds, 'NetworkReachableAnalysisIds', 'json');
  }
  var query = {};
  if (!$isNull(request.networkReachableAnalysisIdsShrink)) {
    query['NetworkReachableAnalysisIds'] = request.networkReachableAnalysisIdsShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteNetworkReachableAnalysis',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a task for analyzing network reachability.
 *
 * @param request DeleteNetworkReachableAnalysisRequest
 * @return DeleteNetworkReachableAnalysisResponse
 */
async function deleteNetworkReachableAnalysis(request: DeleteNetworkReachableAnalysisRequest): DeleteNetworkReachableAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return deleteNetworkReachableAnalysisWithOptions(request, runtime);
}

model DeleteNisInspectionReportRequest {
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-ffd1af****196d0'),
}

model DeleteNisInspectionReportResponseBody = {
  data?: boolean(name='Data', example='True'),
  requestId?: string(name='RequestId', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
}

model DeleteNisInspectionReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNisInspectionReportResponseBody(name='body'),
}

/**
 * @summary 删除报告
 *
 * @param request DeleteNisInspectionReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNisInspectionReportResponse
 */
async function deleteNisInspectionReportWithOptions(request: DeleteNisInspectionReportRequest, runtime: $RuntimeOptions): DeleteNisInspectionReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionReportId)) {
    query['InspectionReportId'] = request.inspectionReportId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteNisInspectionReport',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除报告
 *
 * @param request DeleteNisInspectionReportRequest
 * @return DeleteNisInspectionReportResponse
 */
async function deleteNisInspectionReport(request: DeleteNisInspectionReportRequest): DeleteNisInspectionReportResponse {
  var runtime = new $RuntimeOptions{};
  return deleteNisInspectionReportWithOptions(request, runtime);
}

model DeleteNisInspectionTaskRequest {
  inspectionTaskId?: string(name='InspectionTaskId', description='This parameter is required.', example='ni-209d****wfirfwc2yl'),
}

model DeleteNisInspectionTaskResponseBody = {
  data?: boolean(name='Data', example='True'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
}

model DeleteNisInspectionTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNisInspectionTaskResponseBody(name='body'),
}

/**
 * @summary 删除巡检任务
 *
 * @param request DeleteNisInspectionTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNisInspectionTaskResponse
 */
async function deleteNisInspectionTaskWithOptions(request: DeleteNisInspectionTaskRequest, runtime: $RuntimeOptions): DeleteNisInspectionTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteNisInspectionTask',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除巡检任务
 *
 * @param request DeleteNisInspectionTaskRequest
 * @return DeleteNisInspectionTaskResponse
 */
async function deleteNisInspectionTask(request: DeleteNisInspectionTaskRequest): DeleteNisInspectionTaskResponse {
  var runtime = new $RuntimeOptions{};
  return deleteNisInspectionTaskWithOptions(request, runtime);
}

model DescribeNisInspectionRecommendationResourcesRequest {
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-ffd1af****196d0'),
  language?: string(name='Language', example='zh-CN'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml16/uO3mvCyHxSjzdhx9VRUC+8umDTIV2Wg9TTOUrR7ve'),
  recommendationCode?: string(name='RecommendationCode', description='This parameter is required.', example='nat_snat_cross_az_warn'),
}

model DescribeNisInspectionRecommendationResourcesResponseBody = {
  inspectionReportId?: string(name='InspectionReportId', example='nir-ffd1af****196d0'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='qt0DqY2lXxwBt9/ROQoS/7J9p90D1vF2vFbwzb/1oSWr3AxcM6/KpObZ7Z1PZdcV'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
  resourceList?: [ 
    {
      analysisData?: string(name='AnalysisData', example='{ResourceId: "ngw-p0wn04hi4****q2us6q7q"}'),
      resourceId?: string(name='ResourceId', example='ngw-p0wn04hi4****q2us6q7q'),
      resourceName?: string(name='ResourceName'),
    }
  ](name='ResourceList'),
  totalCount?: int32(name='TotalCount', example='192'),
}

model DescribeNisInspectionRecommendationResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNisInspectionRecommendationResourcesResponseBody(name='body'),
}

/**
 * @summary 受影响资源列表
 *
 * @param request DescribeNisInspectionRecommendationResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNisInspectionRecommendationResourcesResponse
 */
async function describeNisInspectionRecommendationResourcesWithOptions(request: DescribeNisInspectionRecommendationResourcesRequest, runtime: $RuntimeOptions): DescribeNisInspectionRecommendationResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionReportId)) {
    query['InspectionReportId'] = request.inspectionReportId;
  }
  if (!$isNull(request.language)) {
    query['Language'] = request.language;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.recommendationCode)) {
    query['RecommendationCode'] = request.recommendationCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNisInspectionRecommendationResources',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 受影响资源列表
 *
 * @param request DescribeNisInspectionRecommendationResourcesRequest
 * @return DescribeNisInspectionRecommendationResourcesResponse
 */
async function describeNisInspectionRecommendationResources(request: DescribeNisInspectionRecommendationResourcesRequest): DescribeNisInspectionRecommendationResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return describeNisInspectionRecommendationResourcesWithOptions(request, runtime);
}

model DescribeNisInspectionReportCheckItemsRequest {
  categoryCode?: string(name='CategoryCode', example='stability'),
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-ffd1af****196d0'),
  language?: string(name='Language', example='zh-CN'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml16/uO3mvCyHxSjzdhx9VRUC+8umDTIV2Wg9TTOUrR7ve'),
  resourceType?: [ string ](name='ResourceType'),
  riskLevel?: [ string ](name='RiskLevel'),
}

model DescribeNisInspectionReportCheckItemsShrinkRequest {
  categoryCode?: string(name='CategoryCode', example='stability'),
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-ffd1af****196d0'),
  language?: string(name='Language', example='zh-CN'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml16/uO3mvCyHxSjzdhx9VRUC+8umDTIV2Wg9TTOUrR7ve'),
  resourceTypeShrink?: string(name='ResourceType'),
  riskLevelShrink?: string(name='RiskLevel'),
}

model DescribeNisInspectionReportCheckItemsResponseBody = {
  checkItemList?: [ 
    {
      categoryCode?: string(name='CategoryCode', example='stability'),
      checkItemCode?: string(name='CheckItemCode', example='item_nat_water_level_check'),
      checkItemName?: string(name='CheckItemName'),
      checkResultList?: [ 
        {
          count?: int32(name='Count', example='0'),
          riskLevel?: string(name='RiskLevel'),
        }
      ](name='CheckResultList'),
      description?: string(name='Description'),
      recommendationList?: [ 
        {
          abnormality?: string(name='Abnormality'),
          metadata?: string(name='Metadata'),
          reason?: string(name='Reason'),
          reasonCode?: string(name='ReasonCode'),
          recommendationCode?: string(name='RecommendationCode', example='nat_snat_cross_az_warn'),
          riskLevel?: string(name='RiskLevel'),
          suggestion?: string(name='Suggestion'),
          suggestionCode?: string(name='SuggestionCode'),
        }
      ](name='RecommendationList'),
      resourceType?: string(name='ResourceType', example='NAT'),
    }
  ](name='CheckItemList'),
  inspectionReportId?: string(name='InspectionReportId', example='nir-ffd1af****196d0'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml194Cz/lMNdmr+DEh0th6dVlNEo/F148UPCh2itDku7Qj'),
  requestId?: string(name='RequestId', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
  totalCount?: int32(name='TotalCount', example='11'),
}

model DescribeNisInspectionReportCheckItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNisInspectionReportCheckItemsResponseBody(name='body'),
}

/**
 * @summary 报告巡检项列表
 *
 * @param tmpReq DescribeNisInspectionReportCheckItemsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNisInspectionReportCheckItemsResponse
 */
async function describeNisInspectionReportCheckItemsWithOptions(tmpReq: DescribeNisInspectionReportCheckItemsRequest, runtime: $RuntimeOptions): DescribeNisInspectionReportCheckItemsResponse {
  tmpReq.validate();
  var request = new DescribeNisInspectionReportCheckItemsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.resourceType)) {
    request.resourceTypeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceType, 'ResourceType', 'json');
  }
  if (!$isNull(tmpReq.riskLevel)) {
    request.riskLevelShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.riskLevel, 'RiskLevel', 'json');
  }
  var query = {};
  if (!$isNull(request.categoryCode)) {
    query['CategoryCode'] = request.categoryCode;
  }
  if (!$isNull(request.inspectionReportId)) {
    query['InspectionReportId'] = request.inspectionReportId;
  }
  if (!$isNull(request.language)) {
    query['Language'] = request.language;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceTypeShrink)) {
    query['ResourceType'] = request.resourceTypeShrink;
  }
  if (!$isNull(request.riskLevelShrink)) {
    query['RiskLevel'] = request.riskLevelShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNisInspectionReportCheckItems',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 报告巡检项列表
 *
 * @param request DescribeNisInspectionReportCheckItemsRequest
 * @return DescribeNisInspectionReportCheckItemsResponse
 */
async function describeNisInspectionReportCheckItems(request: DescribeNisInspectionReportCheckItemsRequest): DescribeNisInspectionReportCheckItemsResponse {
  var runtime = new $RuntimeOptions{};
  return describeNisInspectionReportCheckItemsWithOptions(request, runtime);
}

model DescribeNisInspectionReportStatusRequest {
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-2ca527b8de114ba4afb9'),
}

model DescribeNisInspectionReportStatusResponseBody = {
  endTime?: string(name='EndTime', example='2024-07-18 15:13:07'),
  inspectionProject?: string(name='InspectionProject', example='basic'),
  inspectionReportId?: string(name='InspectionReportId', example='nir-2ca527b8de114ba4afb9'),
  inspectionTaskId?: string(name='InspectionTaskId', example='ni-8svmpe0yso****r7fh79'),
  inspectionTaskName?: string(name='InspectionTaskName'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
  startTime?: string(name='StartTime', example='2024-07-18 15:12:28'),
  status?: string(name='Status', example='Finish'),
}

model DescribeNisInspectionReportStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNisInspectionReportStatusResponseBody(name='body'),
}

/**
 * @summary 查询报告状态
 *
 * @param request DescribeNisInspectionReportStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNisInspectionReportStatusResponse
 */
async function describeNisInspectionReportStatusWithOptions(request: DescribeNisInspectionReportStatusRequest, runtime: $RuntimeOptions): DescribeNisInspectionReportStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionReportId)) {
    query['InspectionReportId'] = request.inspectionReportId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNisInspectionReportStatus',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询报告状态
 *
 * @param request DescribeNisInspectionReportStatusRequest
 * @return DescribeNisInspectionReportStatusResponse
 */
async function describeNisInspectionReportStatus(request: DescribeNisInspectionReportStatusRequest): DescribeNisInspectionReportStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeNisInspectionReportStatusWithOptions(request, runtime);
}

model DescribeNisInspectionReportSummaryRequest {
  inspectionReportId?: string(name='InspectionReportId', description='This parameter is required.', example='nir-38abb318b27b49cc9a01'),
}

model DescribeNisInspectionReportSummaryResponseBody = {
  endTime?: string(name='EndTime', example='2024-06-03 09:36:00'),
  inspectionReportId?: string(name='InspectionReportId', example='nir-38abb318b27b49cc9a01'),
  inspectionTaskId?: string(name='InspectionTaskId', example='ni-8svmpe0yso2bhzr7fh79'),
  requestId?: string(name='RequestId', example='4838F3F2-30E1-5D82-B25A-B9FE33BC3E25'),
  startTime?: string(name='StartTime', example='2024-06-03 09:35:00'),
  status?: string(name='Status', example='Active'),
  summary?: {
    checkItemCount?: int32(name='CheckItemCount', example='11'),
    checkResourceCount?: int32(name='CheckResourceCount', example='123'),
    passRateSummary?: [ 
      {
        passRate?: double(name='PassRate', example='0.98'),
        passRateScope?: string(name='PassRateScope', example='Stability'),
      }
    ](name='PassRateSummary'),
    riskSummary?: [ 
      {
        resourceCount?: int32(name='ResourceCount', example='0'),
        riskCount?: int32(name='RiskCount', example='3'),
        riskLevel?: string(name='RiskLevel', example='HighRisk'),
        riskType?: string(name='RiskType', example='StabilityRisk'),
      }
    ](name='RiskSummary'),
  }(name='Summary'),
}

model DescribeNisInspectionReportSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNisInspectionReportSummaryResponseBody(name='body'),
}

/**
 * @summary 报告总结信息
 *
 * @param request DescribeNisInspectionReportSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNisInspectionReportSummaryResponse
 */
async function describeNisInspectionReportSummaryWithOptions(request: DescribeNisInspectionReportSummaryRequest, runtime: $RuntimeOptions): DescribeNisInspectionReportSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionReportId)) {
    query['InspectionReportId'] = request.inspectionReportId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNisInspectionReportSummary',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 报告总结信息
 *
 * @param request DescribeNisInspectionReportSummaryRequest
 * @return DescribeNisInspectionReportSummaryResponse
 */
async function describeNisInspectionReportSummary(request: DescribeNisInspectionReportSummaryRequest): DescribeNisInspectionReportSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return describeNisInspectionReportSummaryWithOptions(request, runtime);
}

model DescribeNisInspectionTaskRequest {
  inspectionTaskId?: string(name='InspectionTaskId', description='This parameter is required.', example='ni-8svmpe0yso2bhzr7fh79'),
}

model DescribeNisInspectionTaskResponseBody = {
  checkResourceList?: [ 
    {
      checkScope?: string(name='CheckScope', example='CheckAll'),
      resourceType?: string(name='ResourceType', example='EIP'),
    }
  ](name='CheckResourceList'),
  createTime?: string(name='CreateTime', example='2024-07-01 10:00:57'),
  inspectionInterval?: string(name='InspectionInterval', example='1'),
  inspectionName?: string(name='InspectionName', example='Default'),
  inspectionProject?: string(name='InspectionProject', example='basic'),
  inspectionTaskId?: string(name='InspectionTaskId', example='ni-8svmpe0yso2bhzr7fh79'),
  inspectionTriggerTime?: string(name='InspectionTriggerTime', example='2024-07-01 15:15:57'),
  lastUpdateReportId?: string(name='LastUpdateReportId', example='nir-7c3dd178738a429abe6d'),
  lastUpdateTime?: string(name='LastUpdateTime', example='2024-07-01 10:00:59'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
  status?: string(name='Status', example='Active'),
}

model DescribeNisInspectionTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNisInspectionTaskResponseBody(name='body'),
}

/**
 * @summary 查询巡检任务
 *
 * @param request DescribeNisInspectionTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNisInspectionTaskResponse
 */
async function describeNisInspectionTaskWithOptions(request: DescribeNisInspectionTaskRequest, runtime: $RuntimeOptions): DescribeNisInspectionTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNisInspectionTask',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询巡检任务
 *
 * @param request DescribeNisInspectionTaskRequest
 * @return DescribeNisInspectionTaskResponse
 */
async function describeNisInspectionTask(request: DescribeNisInspectionTaskRequest): DescribeNisInspectionTaskResponse {
  var runtime = new $RuntimeOptions{};
  return describeNisInspectionTaskWithOptions(request, runtime);
}

model GetInternetTupleRequest {
  accountIds?: [ long ](name='AccountIds', description='The IDs of member accounts.'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1684373600099'),
  cloudIp?: string(name='CloudIp', description='The local IP address.', example='112.74.XX.XX'),
  cloudIpList?: [ string ](name='CloudIpList', description='The local IP addresses for filtering.'),
  cloudIsp?: string(name='CloudIsp', description='The local Internet service provider (ISP).

>  In most cases, the value is Alibaba or Alibaba Cloud.', example='Alibaba'),
  cloudPort?: string(name='CloudPort', description='The local port.

>  This parameter is required only if you set GroupBy to CloudPort.', example='443'),
  direction?: string(name='Direction', description='The direction of the Internet traffic that you want to query. Valid values:

*   **in**: inbound
*   **out**: outbound

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1684373700099'),
  instanceId?: string(name='InstanceId', description='The ID of the Alibaba Cloud instance.', example='eip-sample*'),
  instanceList?: [ string ](name='InstanceList', description='The instance IDs for filtering.'),
  orderBy?: string(name='OrderBy', description='The metric for data ranking. Default value: **ByteCount**. This value indicates that Internet traffic data is ranked by traffic volume.

Valid values:

*   Rtt
*   ByteCount
*   PacketCount
*   RetransmitRate', example='ByteCount'),
  otherCity?: string(name='OtherCity', description='The remote city.

>  This parameter is required only if you set **TupleType** to **2** or **5**.', example='Hangzhou'),
  otherCountry?: string(name='OtherCountry', description='The remote country.

>  This parameter is required only if you set **TupleType** to **2** or **5**.', example='China'),
  otherIp?: string(name='OtherIp', description='The remote IP address.

> This parameter is required only when you set **TupleType** to **2** or **5**.', example='122.112.XX.XX'),
  otherIsp?: string(name='OtherIsp', description='The remote ISP.

> This parameter is required if you want to view the information about the remote ISP.', example='China Mobile'),
  otherPort?: string(name='OtherPort', description='The remote port.

> This parameter is required only when you set **TupleType** to **5**.', example='40002'),
  protocol?: string(name='Protocol', description='The protocol number.

> All protocols are supported. This parameter is required only when you set **TupleType** to **5**.', example='6'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to query the Internet traffic.

This parameter is required.', example='cn-shanghai'),
  sort?: string(name='Sort', description='The order in which instances are ranked by Internet traffic. Valid values:

*   **desc**: the descending order
*   **asc**: the ascending order', example='desc'),
  topN?: int32(name='TopN', description='Specifies top-N traffic data to display. Default value: **10**. This value specifies to display top-10 traffic data by default. Max value: **100**.', example='10'),
  tupleType?: int32(name='TupleType', description='The type of the tuple. Valid values:

*   **1**: 1-tuple
*   **2**: 2-tuple
*   **5**: 5-tuple

This parameter is required.', example='1'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
}

model GetInternetTupleShrinkRequest {
  accountIds?: [ long ](name='AccountIds', description='The IDs of member accounts.'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1684373600099'),
  cloudIp?: string(name='CloudIp', description='The local IP address.', example='112.74.XX.XX'),
  cloudIpListShrink?: string(name='CloudIpList', description='The local IP addresses for filtering.'),
  cloudIsp?: string(name='CloudIsp', description='The local Internet service provider (ISP).

>  In most cases, the value is Alibaba or Alibaba Cloud.', example='Alibaba'),
  cloudPort?: string(name='CloudPort', description='The local port.

>  This parameter is required only if you set GroupBy to CloudPort.', example='443'),
  direction?: string(name='Direction', description='The direction of the Internet traffic that you want to query. Valid values:

*   **in**: inbound
*   **out**: outbound

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1684373700099'),
  instanceId?: string(name='InstanceId', description='The ID of the Alibaba Cloud instance.', example='eip-sample*'),
  instanceListShrink?: string(name='InstanceList', description='The instance IDs for filtering.'),
  orderBy?: string(name='OrderBy', description='The metric for data ranking. Default value: **ByteCount**. This value indicates that Internet traffic data is ranked by traffic volume.

Valid values:

*   Rtt
*   ByteCount
*   PacketCount
*   RetransmitRate', example='ByteCount'),
  otherCity?: string(name='OtherCity', description='The remote city.

>  This parameter is required only if you set **TupleType** to **2** or **5**.', example='Hangzhou'),
  otherCountry?: string(name='OtherCountry', description='The remote country.

>  This parameter is required only if you set **TupleType** to **2** or **5**.', example='China'),
  otherIp?: string(name='OtherIp', description='The remote IP address.

> This parameter is required only when you set **TupleType** to **2** or **5**.', example='122.112.XX.XX'),
  otherIsp?: string(name='OtherIsp', description='The remote ISP.

> This parameter is required if you want to view the information about the remote ISP.', example='China Mobile'),
  otherPort?: string(name='OtherPort', description='The remote port.

> This parameter is required only when you set **TupleType** to **5**.', example='40002'),
  protocol?: string(name='Protocol', description='The protocol number.

> All protocols are supported. This parameter is required only when you set **TupleType** to **5**.', example='6'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to query the Internet traffic.

This parameter is required.', example='cn-shanghai'),
  sort?: string(name='Sort', description='The order in which instances are ranked by Internet traffic. Valid values:

*   **desc**: the descending order
*   **asc**: the ascending order', example='desc'),
  topN?: int32(name='TopN', description='Specifies top-N traffic data to display. Default value: **10**. This value specifies to display top-10 traffic data by default. Max value: **100**.', example='10'),
  tupleType?: int32(name='TupleType', description='The type of the tuple. Valid values:

*   **1**: 1-tuple
*   **2**: 2-tuple
*   **5**: 5-tuple

This parameter is required.', example='1'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
}

model GetInternetTupleResponseBody = {
  data?: [ 
    {
      accessRegion?: string(name='AccessRegion', description='The access point of Alibaba Cloud.

>  This parameter is valid only if you set **InstanceId** to the instance ID of an Anycast elastic IP address (EIP).', example='cn-hongkong-pop'),
      beginTime?: string(name='BeginTime', description='The beginning of the time range that you queried. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1684373600099'),
      byteCount?: double(name='ByteCount', description='The traffic volume. Unit: bytes.', example='88'),
      cloudCity?: string(name='CloudCity', description='The local city.', example='Nanjing'),
      cloudCountry?: string(name='CloudCountry', description='The local country or region.', example='China'),
      cloudIp?: string(name='CloudIp', description='The local IP address.', example='112.74.XX.XX'),
      cloudIsp?: string(name='CloudIsp', description='The local ISP.', example='China Mobile'),
      cloudPort?: string(name='CloudPort', description='The local port.', example='443'),
      cloudProduct?: string(name='CloudProduct', description='The service code of the instance to which the local IP address belongs.', example='EIP'),
      cloudProvince?: string(name='CloudProvince', description='The local province.', example='Jiangsu'),
      direction?: string(name='Direction', description='The direction of Internet traffic. Valid values:

*   **in**: inbound
*   **out**: outbound', example='in'),
      inByteCount?: double(name='InByteCount', description='The inbound traffic volume. Unit: bytes.', example='88'),
      inOutOrderCount?: double(name='InOutOrderCount', description='The number of inbound disordered packets.', example='2'),
      inPacketCount?: double(name='InPacketCount', description='The number of inbound packets.', example='33'),
      inRetranCount?: double(name='InRetranCount', description='The number of inbound repeated packets.', example='0'),
      instanceId?: string(name='InstanceId', description='The ID of the instance to which the local IP address belongs.', example='eip-sample*'),
      otherCity?: string(name='OtherCity', description='The remote city. In most cases, this parameter is empty if you set **OtherCountry** to a country except China.', example='Austin'),
      otherCountry?: string(name='OtherCountry', description='The remote country or region.', example='United States'),
      otherIp?: string(name='OtherIp', description='The remote IP address.', example='122.112.XX.XX'),
      otherIsp?: string(name='OtherIsp', description='The remote ISP.', example='amazon.com'),
      otherPort?: string(name='OtherPort', description='The remote port.', example='40002'),
      otherProduct?: string(name='OtherProduct', description='The service code of the instance to which the remote IP address belongs. If the IP address is not on the cloud, this parameter is empty.', example='ECS'),
      otherProvince?: string(name='OtherProvince', description='The remote province. In most cases, this parameter is empty if you set **OtherCountry** to a country except China.', example='Texas'),
      outByteCount?: double(name='OutByteCount', description='The outbound traffic volume. Unit: bytes.', example='66'),
      outOrderCount?: double(name='OutOrderCount', description='The number of disordered packets.', example='1'),
      outOutOrderCount?: double(name='OutOutOrderCount', description='The number of outbound disordered packets.', example='1'),
      outPacketCount?: double(name='OutPacketCount', description='The number of outbound packets.', example='22'),
      outRetranCount?: double(name='OutRetranCount', description='The number of outbound repeated packets.', example='1'),
      packetCount?: double(name='PacketCount', description='The number of packets.', example='66'),
      protocol?: string(name='Protocol', description='The protocol number.', example='6'),
      retransmitRate?: double(name='RetransmitRate', description='The retransmission rate of TCP packets.', example='0.1'),
      rtt?: double(name='Rtt', description='The round-trip time (RTT). Unit: milliseconds.', example='10000'),
    }
  ](name='Data', description='The ranking result of Internet traffic data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
}

model GetInternetTupleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInternetTupleResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GetInternetTuple is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of Internet traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Internet traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param tmpReq GetInternetTupleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInternetTupleResponse
 */
// Deprecated
async function getInternetTupleWithOptions(tmpReq: GetInternetTupleRequest, runtime: $RuntimeOptions): GetInternetTupleResponse {
  tmpReq.validate();
  var request = new GetInternetTupleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.cloudIpList)) {
    request.cloudIpListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.cloudIpList, 'CloudIpList', 'json');
  }
  if (!$isNull(tmpReq.instanceList)) {
    request.instanceListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceList, 'InstanceList', 'json');
  }
  var query = {};
  if (!$isNull(request.accountIds)) {
    query['AccountIds'] = request.accountIds;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.cloudIp)) {
    query['CloudIp'] = request.cloudIp;
  }
  if (!$isNull(request.cloudIpListShrink)) {
    query['CloudIpList'] = request.cloudIpListShrink;
  }
  if (!$isNull(request.cloudIsp)) {
    query['CloudIsp'] = request.cloudIsp;
  }
  if (!$isNull(request.cloudPort)) {
    query['CloudPort'] = request.cloudPort;
  }
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.instanceListShrink)) {
    query['InstanceList'] = request.instanceListShrink;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.otherCity)) {
    query['OtherCity'] = request.otherCity;
  }
  if (!$isNull(request.otherCountry)) {
    query['OtherCountry'] = request.otherCountry;
  }
  if (!$isNull(request.otherIp)) {
    query['OtherIp'] = request.otherIp;
  }
  if (!$isNull(request.otherIsp)) {
    query['OtherIsp'] = request.otherIsp;
  }
  if (!$isNull(request.otherPort)) {
    query['OtherPort'] = request.otherPort;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!$isNull(request.topN)) {
    query['TopN'] = request.topN;
  }
  if (!$isNull(request.tupleType)) {
    query['TupleType'] = request.tupleType;
  }
  if (!$isNull(request.useMultiAccount)) {
    query['UseMultiAccount'] = request.useMultiAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInternetTuple',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GetInternetTuple is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of Internet traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Internet traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param request GetInternetTupleRequest
 * @return GetInternetTupleResponse
 */
// Deprecated
async function getInternetTuple(request: GetInternetTupleRequest): GetInternetTupleResponse {
  var runtime = new $RuntimeOptions{};
  return getInternetTupleWithOptions(request, runtime);
}

model GetNatTopNRequest {
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query in milliseconds. If you do not specify **EndTime**, the point in time specified by **BeginTime** is queried.

This parameter is required.', example='1638239092000'),
  endTime?: long(name='EndTime', description='The end of the time range to query in milliseconds. The time range specified by **BeginTime** and **EndTime** cannot exceed **86400000** milliseconds (24 hours).', example='1638239093000'),
  ip?: string(name='Ip', description='Query ranking statistics for a specific IP address. If you specify this parameter, you do not need to specify **TopN** or **OrderBy**.', example='192.168.156.101'),
  natGatewayId?: string(name='NatGatewayId', description='The ID of the NAT gateway.

This parameter is required.', example='ngw-sample***'),
  orderBy?: string(name='OrderBy', description='The metric that is used for real-time SNAT performance ranking. Valid values:

*   **InBps**: inbound data transfer. Unit: bit/s.
*   **OutBps**: outbound data transfer. Unit: bit/s.
*   **InPps**: inbound packet forwarding rate. Unit: packets per second.
*   **OutPps**: outbound packet forwarding rate. Unit: packets per second.
*   **NewSessionPerSecond**: new connection creation rate. Unit: connections per second.
*   **ActiveSessionCount**: number of concurrent connections. Unit: connections.', example='InBps'),
  regionId?: string(name='RegionId', description='The ID of the region in which the NAT gateway is deployed.', example='cn-shanghai'),
  topN?: int32(name='TopN', description='The number of entries to return for real-time SNAT performance ranking. Valid values: **1 to 100**. Default value: **10**.', example='10'),
}

model GetNatTopNResponseBody = {
  isTopNOpen?: boolean(name='IsTopNOpen', description='Indicates whether Network Intelligence Service (NIS) is activated. The NatGatewayTopN parameter returns an empty array when NIS is not activated.

*   **true**: activated
*   **false**: not activated', example='true'),
  natGatewayTopN?: [ 
    {
      activeSessionCount?: float(name='ActiveSessionCount', description='The number of concurrent connections. Unit: connections.', example='8'),
      inBps?: float(name='InBps', description='The inbound data transfer. Unit: bit/s.', example='100'),
      inFlowPerMinute?: float(name='InFlowPerMinute', description='This field is reserved and not in use.', example='10'),
      inPps?: float(name='InPps', description='The inbound packet forwarding rate. Unit: packets per second.', example='10'),
      ip?: string(name='Ip', description='The IP address.', example='192.168.156.101'),
      newSessionPerSecond?: float(name='NewSessionPerSecond', description='The new connection creation rate. Unit: connections per second.', example='2'),
      outBps?: float(name='OutBps', description='The outbound data transfer. Unit: bit/s.', example='200'),
      outFlowPerMinute?: float(name='OutFlowPerMinute', description='This field is reserved and not in use.', example='10'),
      outPps?: float(name='OutPps', description='The outbound packet forwarding rate. Unit: packets per second.', example='20'),
    }
  ](name='NatGatewayTopN', description='An array of statistics about real-time SNAT performance ranking.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='77C512B5-12f3-f892-BD94-88A98271C1A0'),
}

model GetNatTopNResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNatTopNResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GetNatTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the real-time SNAT performance ranking of a NAT gateway.
 *
 * @param request GetNatTopNRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNatTopNResponse
 */
// Deprecated
async function getNatTopNWithOptions(request: GetNatTopNRequest, runtime: $RuntimeOptions): GetNatTopNResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!$isNull(request.natGatewayId)) {
    query['NatGatewayId'] = request.natGatewayId;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.topN)) {
    query['TopN'] = request.topN;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetNatTopN',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GetNatTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the real-time SNAT performance ranking of a NAT gateway.
 *
 * @param request GetNatTopNRequest
 * @return GetNatTopNResponse
 */
// Deprecated
async function getNatTopN(request: GetNatTopNRequest): GetNatTopNResponse {
  var runtime = new $RuntimeOptions{};
  return getNatTopNWithOptions(request, runtime);
}

model GetNetworkReachableAnalysisRequest {
  networkReachableAnalysisId?: string(name='NetworkReachableAnalysisId', description='The ID of the task for analyzing network reachability. You can call the **CreateNetworkRearchableAnalysis** operation to obtain the ID of the task for analyzing network reachability.

This parameter is required.', example='nra-90eef36a9e6e4662****'),
  regionId?: string(name='RegionId', description='The ID of the region for which you want to obtain the result of network reachability analysis.', example='cn-shanghai'),
}

model GetNetworkReachableAnalysisResponseBody = {
  aliUid?: long(name='AliUid', description='The unique ID (UID) of the Alibaba Cloud account.', example='123147627844****'),
  createTime?: string(name='CreateTime', description='The time when the network path was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-03-16T07:11:27Z'),
  networkPathId?: string(name='NetworkPathId', description='The network path ID.', example='np-2a1332214fa346b6****'),
  networkPathParameter?: string(name='NetworkPathParameter', description='The parameters of the network path.', example='{
  "sourceId": "i-bp100g5pbp6kj4p9****",
  "sourceType": "ecs",
  "targetId": "i-t4n4ltwgbbomzb0g****",
  "targetType": "ecs"
}'),
  networkReachableAnalysisId?: string(name='NetworkReachableAnalysisId', description='The ID of the task for analyzing network reachability.', example='nra-8607514e71c1484****'),
  networkReachableAnalysisResult?: string(name='NetworkReachableAnalysisResult', description='The result of network reachability analysis, which includes the network topology, error codes of network unreachability, and rules of network unreachability.', example='{
  "errorCode": "",
  "networkAclData": {
    "networkAclItems": [
      
    ]
  },
  "nraId": "nra-f2c8701a36424094****",
  "requestId": "B931F8A0-620E-5230-B77F-3BD7F612****",
  "routeData": {
    "routeItems": [
      
    ]
  },
  "securityGroupData": {
    "policy": "accept",
    "securityGroupItems": [
      {
        "description": "default_sg_access_rule",
        "matchedRule": {
          "bizProtocol": "ALL",
          "creatingTime": "2022-11-10T03:24:49Z",
          "description": "",
          "destinationCidr": "",
          "destinationGroupId": "sg-wz980j96p8y99co5****",
          "direction": "egress",
          "policy": "Accept",
          "portRange": "-1/-1",
          "priority": "1",
          "sourceCidr": "",
          "sourceGroupId": ""
        },
        "policy": "accept",
        "resourceId": "eni-wz92ce4saz1jzazg****",
        "securityGroupId": "sg-wz980j96p8y99co5****"
      },
      {
        "description": "user_acl_drop_rule",
        "matchedRule": {
          "bizProtocol": "",
          "creatingTime": "",
          "description": "",
          "destinationCidr": "",
          "destinationGroupId": "",
          "direction": "",
          "policy": "",
          "portRange": "",
          "priority": "",
          "sourceCidr": "",
          "sourceGroupId": ""
        },
        "policy": "",
        "resourceId": "eni-wz97vry93t6z4lbd****",
        "securityGroupId": "sg-wz980j96p8y99co****"
      }
    ],
    "securityGroupReportId": "sgr-4479d23bb37241aab****"
  },
  "status": "security_group_checking_target",
  "topologyData": {
    "positive": {
      "linkList": [
        {
          "id": "i-wz91dk7bor557hp93zyv-->eni-wz92ce4saz1jzazg****",
          "source": "i-wz91dk7bor557hp9****",
          "target": "eni-wz92ce4saz1jzazg****"
        },
        {
          "id": "eni-wz92ce4saz1jzazgi13d-->vsw-wz9slpwdcppwfrnee****",
          "source": "eni-wz92ce4saz1jzazg****",
          "target": "vsw-wz9slpwdcppwfrnee****"
        },
        {
          "id": "vsw-wz9slpwdcppwfrneebcrp-->eni-wz97vry93t6z4lbd****",
          "source": "vsw-wz9slpwdcppwfrnee****",
          "target": "eni-wz97vry93t6z4lbd****"
        },
        {
          "id": "eni-wz97vry93t6z4lbdgmfi-->i-wz91dk7bor557hp9****",
          "source": "eni-wz97vry93t6z4lbd****",
          "target": "i-wz91dk7bor557hp9****"
        }
      ],
      "nodeList": [
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "i-wz91dk7bor557hp9****",
          "id": "i-wz91dk7bor557hp9****",
          "level": 1,
          "matchedRoute": {
            "nextHopSet": [
              
            ]
          },
          "nodeType": "VM",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "trafficLogs": [
            
          ]
        },
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "i-wz91dk7bor557hp9****",
          "id": "i-wz91dk7bor557hp9****",
          "level": 3,
          "matchedRoute": {
            "nextHopSet": [
              
            ]
          },
          "nodeType": "VM",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "trafficLogs": [
            
          ]
        },
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "vsw-wz9slpwdcppwfrnee****",
          "cidr": "192.168.0.0/24",
          "id": "vsw-wz9slpwdcppwfrnee****",
          "level": 2,
          "matchedRoute": {
            "nextHopSet": [
              
            ]
          },
          "nodeType": "VSW",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "trafficLogs": [
            
          ]
        },
        {
          "bizInsId": "eni-wz92ce4saz1jzazg****",
          "id": "eni-wz92ce4saz1jzazg****",
          "ip": "192.168.0.33",
          "mac": "00:XXXX:3e:16:7c:50",
          "matchedRoute": {
            "nextHopSet": [
              
            ]
          },
          "nodeType": "ENI",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "status": "InUse",
          "trafficLogs": [
            
          ]
        },
        {
          "bizInsId": "eni-wz97vry93t6z4lbd****",
          "id": "eni-wz97vry93t6z4lbd****",
          "ip": "192.168.0.34",
          "mac": "00:XXXX:3e:14:70:c2",
          "matchedRoute": {
            "nextHopSet": [
              
            ]
          },
          "nodeType": "ENI",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "status": "InUse",
          "trafficLogs": [
            
          ]
        }
      ]
    },
    "reverse": {
      "revLinkList": [
        {
          "id": "i-wz91dk7bor557hp93zys-->eni-wz97vry93t6z4lbd****",
          "source": "i-wz91dk7bor557hp9****",
          "target": "eni-wz97vry93t6z4lbd****"
        },
        {
          "id": "eni-wz97vry93t6z4lbdgmfi-->vsw-wz9slpwdcppwfrnee****",
          "source": "eni-wz97vry93t6z4lbd****",
          "target": "vsw-wz9slpwdcppwfrnee****"
        },
        {
          "id": "vsw-wz9slpwdcppwfrneebcrp-->eni-wz92ce4saz1jzazg****",
          "source": "vsw-wz9slpwdcppwfrnee****",
          "target": "eni-wz92ce4saz1jzazg****"
        },
        {
          "id": "eni-wz92ce4saz1jzazgi13d-->i-wz91dk7bor557hp9****",
          "source": "eni-wz92ce4saz1jzazg****",
          "target": "i-wz91dk7bor557hp9****"
        }
      ],
      "revNodeList": [
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "i-wz91dk7bor557hp9****",
          "id": "i-wz91dk7bor557hp9****",
          "level": 1,
          "nodeType": "VM",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "revMatchedRoute": {
            "revNextHopSet": [
              
            ]
          }
        },
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "i-wz91dk7bor557hp9****",
          "id": "i-wz91dk7bor557hp9****",
          "level": 3,
          "nodeType": "VM",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "revMatchedRoute": {
            "revNextHopSet": [
              
            ]
          }
        },
        {
          "aZone": "cn-shenzhen-d",
          "bizInsId": "vsw-wz9slpwdcppwfrnee****",
          "cidr": "192.168.0.0/24",
          "id": "vsw-wz9slpwdcppwfrnee****",
          "level": 2,
          "nodeType": "VSW",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "revMatchedRoute": {
            "revNextHopSet": [
              
            ]
          }
        },
        {
          "bizInsId": "eni-wz97vry93t6z4lbd****",
          "id": "eni-wz97vry93t6z4lbd****",
          "ip": "192.168.0.34",
          "mac": "00:XXXX:3e:14:70:c2",
          "nodeType": "ENI",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "revMatchedRoute": {
            "revNextHopSet": [
              
            ]
          },
          "status": "InUse"
        },
        {
          "bizInsId": "eni-wz92ce4saz1jzazg****",
          "id": "eni-wz92ce4saz1jzazg****",
          "ip": "192.168.0.33",
          "mac": "00:XXXX:3e:16:7c:50",
          "nodeType": "ENI",
          "regionNo": "cn-shenzhen-st3-a01",
          "regionNoAlias": "cn-shenzhen",
          "revMatchedRoute": {
            "revNextHopSet": [
              
            ]
          },
          "status": "InUse"
        }
      ]
    },
    "topologyReportId": "tpr-21cf60002715491b8****"
  }
}'),
  networkReachableAnalysisStatus?: string(name='NetworkReachableAnalysisStatus', description='The state of the task for analyzing network reachability. Valid values:

*   **init**: The task is in progress.
*   **finish**: The task is complete.
*   **error**: An analysis error occurred.
*   **timeout**: The task timed out.', example='finish'),
  reachable?: boolean(name='Reachable', description='Indicates whether the network path is reachable. Valid values:

*   **true**: The network path is reachable.
*   **false**: The network path is unreachable.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='DEE0FEAF-59AE-5CDD-AA07-626BC365D571'),
}

model GetNetworkReachableAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNetworkReachableAnalysisResponseBody(name='body'),
}

/**
 * @summary Obtains the results of network reachability analysis.
 *
 * @description **GetNetworkReachableAnalysis** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can query the state of the task for analyzing network reachability.
 * *   The **init** state indicates that the task is in progress.
 * *   The **finish** state indicates that the task is complete. In this state, you can obtain the analysis result.
 *
 * @param request GetNetworkReachableAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNetworkReachableAnalysisResponse
 */
async function getNetworkReachableAnalysisWithOptions(request: GetNetworkReachableAnalysisRequest, runtime: $RuntimeOptions): GetNetworkReachableAnalysisResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.networkReachableAnalysisId)) {
    query['NetworkReachableAnalysisId'] = request.networkReachableAnalysisId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetNetworkReachableAnalysis',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the results of network reachability analysis.
 *
 * @description **GetNetworkReachableAnalysis** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can query the state of the task for analyzing network reachability.
 * *   The **init** state indicates that the task is in progress.
 * *   The **finish** state indicates that the task is complete. In this state, you can obtain the analysis result.
 *
 * @param request GetNetworkReachableAnalysisRequest
 * @return GetNetworkReachableAnalysisResponse
 */
async function getNetworkReachableAnalysis(request: GetNetworkReachableAnalysisRequest): GetNetworkReachableAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return getNetworkReachableAnalysisWithOptions(request, runtime);
}

model GetNisNetworkMetricsRequest {
  accountIds?: [ string ](name='AccountIds'),
  beginTime?: long(name='BeginTime', example='1638239092000'),
  dimensions?: [ 
    {
      name?: string(name='Name', example='instanceId'),
      value?: string(name='Value', example='eip-sample*'),
    }
  ](name='Dimensions', description='This parameter is required.'),
  endTime?: long(name='EndTime', example='1684373700099'),
  metricName?: string(name='MetricName', description='This parameter is required.', example='bps'),
  regionNo?: string(name='RegionNo', description='This parameter is required.', example='cn-shenzhen'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='AccessInternetIPV4'),
  scanBy?: string(name='ScanBy', example='TimestampAscending'),
  useCrossAccount?: boolean(name='UseCrossAccount', example='false'),
}

model GetNisNetworkMetricsShrinkRequest {
  accountIds?: [ string ](name='AccountIds'),
  beginTime?: long(name='BeginTime', example='1638239092000'),
  dimensionsShrink?: string(name='Dimensions', description='This parameter is required.'),
  endTime?: long(name='EndTime', example='1684373700099'),
  metricName?: string(name='MetricName', description='This parameter is required.', example='bps'),
  regionNo?: string(name='RegionNo', description='This parameter is required.', example='cn-shenzhen'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='AccessInternetIPV4'),
  scanBy?: string(name='ScanBy', example='TimestampAscending'),
  useCrossAccount?: boolean(name='UseCrossAccount', example='false'),
}

model GetNisNetworkMetricsResponseBody = {
  data?: {
    metrics?: [ 
      {
        timeStamp?: long(name='TimeStamp', example='1690684091100'),
        value?: double(name='Value', example='88'),
      }
    ](name='Metrics'),
    unit?: string(name='Unit', example='Bits/Second'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
}

model GetNisNetworkMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNisNetworkMetricsResponseBody(name='body'),
}

/**
 * @summary 获取云网络指标趋势
 *
 * @param tmpReq GetNisNetworkMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNisNetworkMetricsResponse
 */
async function getNisNetworkMetricsWithOptions(tmpReq: GetNisNetworkMetricsRequest, runtime: $RuntimeOptions): GetNisNetworkMetricsResponse {
  tmpReq.validate();
  var request = new GetNisNetworkMetricsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.dimensions)) {
    request.dimensionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dimensions, 'Dimensions', 'json');
  }
  var query = {};
  if (!$isNull(request.accountIds)) {
    query['AccountIds'] = request.accountIds;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.dimensionsShrink)) {
    query['Dimensions'] = request.dimensionsShrink;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!$isNull(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.scanBy)) {
    query['ScanBy'] = request.scanBy;
  }
  if (!$isNull(request.useCrossAccount)) {
    query['UseCrossAccount'] = request.useCrossAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetNisNetworkMetrics',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取云网络指标趋势
 *
 * @param request GetNisNetworkMetricsRequest
 * @return GetNisNetworkMetricsResponse
 */
async function getNisNetworkMetrics(request: GetNisNetworkMetricsRequest): GetNisNetworkMetricsResponse {
  var runtime = new $RuntimeOptions{};
  return getNisNetworkMetricsWithOptions(request, runtime);
}

model GetNisNetworkRankingRequest {
  accountIds?: [ string ](name='AccountIds'),
  beginTime?: long(name='BeginTime', example='1684373600099'),
  direction?: string(name='Direction', description='This parameter is required.', example='in'),
  endTime?: long(name='EndTime', example='1684379093000'),
  filter?: [ 
    {
      name?: string(name='Name', example='instanceId'),
      value?: string(name='Value', example='lb-2zxxxxz1d'),
    }
  ](name='Filter'),
  groupBy?: string(name='GroupBy', description='This parameter is required.', example='Protocol'),
  orderBy?: string(name='OrderBy', description='This parameter is required.', example='bps'),
  regionNo?: string(name='RegionNo', description='This parameter is required.', example='cn-beijing'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='AccessInternetIpV4'),
  sort?: string(name='Sort', example='desc'),
  topN?: int32(name='TopN', example='10'),
  useCrossAccount?: boolean(name='UseCrossAccount', example='false'),
}

model GetNisNetworkRankingShrinkRequest {
  accountIds?: [ string ](name='AccountIds'),
  beginTime?: long(name='BeginTime', example='1684373600099'),
  direction?: string(name='Direction', description='This parameter is required.', example='in'),
  endTime?: long(name='EndTime', example='1684379093000'),
  filterShrink?: string(name='Filter'),
  groupBy?: string(name='GroupBy', description='This parameter is required.', example='Protocol'),
  orderBy?: string(name='OrderBy', description='This parameter is required.', example='bps'),
  regionNo?: string(name='RegionNo', description='This parameter is required.', example='cn-beijing'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='AccessInternetIpV4'),
  sort?: string(name='Sort', example='desc'),
  topN?: int32(name='TopN', example='10'),
  useCrossAccount?: boolean(name='UseCrossAccount', example='false'),
}

model GetNisNetworkRankingResponseBody = {
  data?: [ 
    {
      activeSessionCount?: double(name='ActiveSessionCount', example='66'),
      asn?: string(name='Asn', example='129103'),
      attachmentId?: string(name='AttachmentId', example='tr-sample*'),
      bandwidthPackageId?: string(name='BandwidthPackageId', example='cbwp-sample*'),
      byteCount?: double(name='ByteCount', example='1024'),
      city?: string(name='City'),
      country?: string(name='Country'),
      destinationIp?: string(name='DestinationIp', example='2.2.XX.XX'),
      destinationIsp?: string(name='DestinationIsp'),
      destinationPort?: string(name='DestinationPort', example='80'),
      destinationRegionNo?: string(name='DestinationRegionNo', example='cn-hangzhou'),
      destinationZone?: string(name='DestinationZone', example='cn-hangzhou-b'),
      IP?: string(name='IP', example='120.238.XX.XX'),
      inBps?: double(name='InBps', example='10'),
      inPps?: double(name='InPps', example='3'),
      instanceId?: string(name='InstanceId', example='eip-sample*'),
      isp?: string(name='Isp'),
      newSessionPerSecond?: double(name='NewSessionPerSecond', example='18'),
      outBps?: double(name='OutBps', example='88'),
      outPps?: double(name='OutPps', example='8'),
      packetCount?: double(name='PacketCount', example='66'),
      protocol?: string(name='Protocol', example='6'),
      province?: string(name='Province'),
      RTT?: double(name='RTT', example='23'),
      regionNo?: string(name='RegionNo', example='cn-shenzhen'),
      retransmitRate?: double(name='RetransmitRate', example='0.1'),
      sourceIp?: string(name='SourceIp', example='42.120.XX.XX'),
      sourceIsp?: string(name='SourceIsp'),
      sourcePort?: string(name='SourcePort', example='443'),
      sourceZone?: string(name='SourceZone', example='cn-hangzhou-a'),
      vbrId?: string(name='VbrId', example='vbr-sample*'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
}

model GetNisNetworkRankingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNisNetworkRankingResponseBody(name='body'),
}

/**
 * @summary 获取云网络指标排名
 *
 * @param tmpReq GetNisNetworkRankingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNisNetworkRankingResponse
 */
async function getNisNetworkRankingWithOptions(tmpReq: GetNisNetworkRankingRequest, runtime: $RuntimeOptions): GetNisNetworkRankingResponse {
  tmpReq.validate();
  var request = new GetNisNetworkRankingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.filter)) {
    request.filterShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filter, 'Filter', 'json');
  }
  var query = {};
  if (!$isNull(request.accountIds)) {
    query['AccountIds'] = request.accountIds;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.filterShrink)) {
    query['Filter'] = request.filterShrink;
  }
  if (!$isNull(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!$isNull(request.topN)) {
    query['TopN'] = request.topN;
  }
  if (!$isNull(request.useCrossAccount)) {
    query['UseCrossAccount'] = request.useCrossAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetNisNetworkRanking',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取云网络指标排名
 *
 * @param request GetNisNetworkRankingRequest
 * @return GetNisNetworkRankingResponse
 */
async function getNisNetworkRanking(request: GetNisNetworkRankingRequest): GetNisNetworkRankingResponse {
  var runtime = new $RuntimeOptions{};
  return getNisNetworkRankingWithOptions(request, runtime);
}

model GetTransitRouterFlowTopNRequest {
  accountIds?: [ long ](name='AccountIds', description='The IDs of the member accounts.'),
  bandwithPackageId?: string(name='BandwithPackageId', description='The ID of the CEN bandwidth plan.', example='cenbwp-ia8kw1zjv4hyal*****'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1684373600099'),
  cenId?: string(name='CenId', description='The CEN instance ID.', example='cen-ia8kw1zjv4hyal****'),
  direction?: string(name='Direction', description='The direction of the inter-region traffic in the local regions or for the local IP addresses. Valid values:

*   **in**: inbound traffic
*   **out**: outbound traffic

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239093000'),
  groupBy?: string(name='GroupBy', description='The dimension for ranking inter-region traffic data. The value of this parameter is case-sensitive. Valid values:

*   **1Tuple**: queries the rankings of inter-region traffic data for the local regions, Cloud Enterprise Network (CEN) instances, and IP addresses.
*   **2Tuple**: queries the rankings of inter-region traffic data for the local and remote regions, and the local and remote IP addresses.
*   **5Tuple**: queries the rankings of inter-region traffic data for the local and remote IP addresses, local and remote ports, and protocols.
*   **Cen**: queries the rankings of inter-region traffic data for CEN instances.
*   **RegionPair**: queries the rankings of inter-region traffic data for the local and remote regions.
*   **Port**: queries the rankings of inter-region traffic data for the local and remote ports.
*   **Protocol**: queries the rankings of inter-region traffic data for the protocols.

This parameter is required.', example='1Tuple'),
  orderBy?: string(name='OrderBy', description='The metric for ranking inter-region traffic data. Default value: Bytes. This value specifies that inter-region traffic data is ranked by traffic volume.', example='Bytes'),
  otherIp?: string(name='OtherIp', description='The remote IP address.', example='122.112.XX.XX'),
  otherPort?: string(name='OtherPort', description='The remote port.', example='10869'),
  otherRegion?: string(name='OtherRegion', description='The remote region.', example='ap-southeast-1'),
  protocol?: string(name='Protocol', description='The protocol number.

>  All protocols are supported. This parameter is required only if you set **GroupBy** to **5Tuple** or **Protocol**.', example='6'),
  sort?: string(name='Sort', description='The order for ranking inter-region traffic data. Valid values:

*   **desc**: descending order
*   **asc**: ascending order', example='desc'),
  thisIp?: string(name='ThisIp', description='The local IP address.', example='1.8.XX.XX'),
  thisPort?: string(name='ThisPort', description='The local port.', example='80'),
  thisRegion?: string(name='ThisRegion', description='The local region where the **local IP address** resides.', example='cn-shanghai'),
  topN?: int32(name='TopN', description='Specifies the maximum number of data entries to display. Default value: **10**. Maximum value: 100.', example='20'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
}

model GetTransitRouterFlowTopNShrinkRequest {
  accountIdsShrink?: string(name='AccountIds', description='The IDs of the member accounts.'),
  bandwithPackageId?: string(name='BandwithPackageId', description='The ID of the CEN bandwidth plan.', example='cenbwp-ia8kw1zjv4hyal*****'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1684373600099'),
  cenId?: string(name='CenId', description='The CEN instance ID.', example='cen-ia8kw1zjv4hyal****'),
  direction?: string(name='Direction', description='The direction of the inter-region traffic in the local regions or for the local IP addresses. Valid values:

*   **in**: inbound traffic
*   **out**: outbound traffic

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239093000'),
  groupBy?: string(name='GroupBy', description='The dimension for ranking inter-region traffic data. The value of this parameter is case-sensitive. Valid values:

*   **1Tuple**: queries the rankings of inter-region traffic data for the local regions, Cloud Enterprise Network (CEN) instances, and IP addresses.
*   **2Tuple**: queries the rankings of inter-region traffic data for the local and remote regions, and the local and remote IP addresses.
*   **5Tuple**: queries the rankings of inter-region traffic data for the local and remote IP addresses, local and remote ports, and protocols.
*   **Cen**: queries the rankings of inter-region traffic data for CEN instances.
*   **RegionPair**: queries the rankings of inter-region traffic data for the local and remote regions.
*   **Port**: queries the rankings of inter-region traffic data for the local and remote ports.
*   **Protocol**: queries the rankings of inter-region traffic data for the protocols.

This parameter is required.', example='1Tuple'),
  orderBy?: string(name='OrderBy', description='The metric for ranking inter-region traffic data. Default value: Bytes. This value specifies that inter-region traffic data is ranked by traffic volume.', example='Bytes'),
  otherIp?: string(name='OtherIp', description='The remote IP address.', example='122.112.XX.XX'),
  otherPort?: string(name='OtherPort', description='The remote port.', example='10869'),
  otherRegion?: string(name='OtherRegion', description='The remote region.', example='ap-southeast-1'),
  protocol?: string(name='Protocol', description='The protocol number.

>  All protocols are supported. This parameter is required only if you set **GroupBy** to **5Tuple** or **Protocol**.', example='6'),
  sort?: string(name='Sort', description='The order for ranking inter-region traffic data. Valid values:

*   **desc**: descending order
*   **asc**: ascending order', example='desc'),
  thisIp?: string(name='ThisIp', description='The local IP address.', example='1.8.XX.XX'),
  thisPort?: string(name='ThisPort', description='The local port.', example='80'),
  thisRegion?: string(name='ThisRegion', description='The local region where the **local IP address** resides.', example='cn-shanghai'),
  topN?: int32(name='TopN', description='Specifies the maximum number of data entries to display. Default value: **10**. Maximum value: 100.', example='20'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
}

model GetTransitRouterFlowTopNResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
  transitRouterFlowTopN?: [ 
    {
      accountId?: string(name='AccountId', description='The account ID.', example='118639953821xxxx'),
      bandwithPackageId?: string(name='BandwithPackageId', description='The ID of the CEN bandwidth plan.', example='cenbwp-ia8kw1zjv4hyal****'),
      bytes?: double(name='Bytes', description='The total volume of traffic in the specified time range.', example='188'),
      cenId?: string(name='CenId', description='The CEN instance ID.', example='cen-ia8kw1zjv4hyal****'),
      endTime?: string(name='EndTime', description='The end of the time range that you queried. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-01-31T06:40:00Z'),
      otherIp?: string(name='OtherIp', description='The remote IP address.', example='47.216.XX.XX'),
      otherPort?: string(name='OtherPort', description='The remote port.', example='53470'),
      otherRegion?: string(name='OtherRegion', description='The remote region where the **remote IP address** resides.', example='ap-southeast-1'),
      packets?: double(name='Packets', description='The total number of packets in the specified time range.', example='88'),
      protocol?: string(name='Protocol', description='The protocol number.', example='6'),
      startTime?: string(name='StartTime', description='The beginning of the time range that you queried. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-01-31T05:40:00Z'),
      thisIp?: string(name='ThisIp', description='The local IP address.', example='1.8.XX.XX'),
      thisPort?: string(name='ThisPort', description='The local port.', example='80'),
      thisRegion?: string(name='ThisRegion', description='The local region where the **local IP address** resides.', example='cn-shanghai'),
    }
  ](name='TransitRouterFlowTopN', description='The ranking result of inter-region traffic data.'),
}

model GetTransitRouterFlowTopNResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTransitRouterFlowTopNResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GetTransitRouterFlowTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of inter-region traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Inter-region traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param tmpReq GetTransitRouterFlowTopNRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTransitRouterFlowTopNResponse
 */
// Deprecated
async function getTransitRouterFlowTopNWithOptions(tmpReq: GetTransitRouterFlowTopNRequest, runtime: $RuntimeOptions): GetTransitRouterFlowTopNResponse {
  tmpReq.validate();
  var request = new GetTransitRouterFlowTopNShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.accountIds)) {
    request.accountIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.accountIds, 'AccountIds', 'json');
  }
  var query = {};
  if (!$isNull(request.accountIdsShrink)) {
    query['AccountIds'] = request.accountIdsShrink;
  }
  if (!$isNull(request.bandwithPackageId)) {
    query['BandwithPackageId'] = request.bandwithPackageId;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.cenId)) {
    query['CenId'] = request.cenId;
  }
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.otherIp)) {
    query['OtherIp'] = request.otherIp;
  }
  if (!$isNull(request.otherPort)) {
    query['OtherPort'] = request.otherPort;
  }
  if (!$isNull(request.otherRegion)) {
    query['OtherRegion'] = request.otherRegion;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!$isNull(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!$isNull(request.thisIp)) {
    query['ThisIp'] = request.thisIp;
  }
  if (!$isNull(request.thisPort)) {
    query['ThisPort'] = request.thisPort;
  }
  if (!$isNull(request.thisRegion)) {
    query['ThisRegion'] = request.thisRegion;
  }
  if (!$isNull(request.topN)) {
    query['TopN'] = request.topN;
  }
  if (!$isNull(request.useMultiAccount)) {
    query['UseMultiAccount'] = request.useMultiAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTransitRouterFlowTopN',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GetTransitRouterFlowTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of inter-region traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Inter-region traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param request GetTransitRouterFlowTopNRequest
 * @return GetTransitRouterFlowTopNResponse
 */
// Deprecated
async function getTransitRouterFlowTopN(request: GetTransitRouterFlowTopNRequest): GetTransitRouterFlowTopNResponse {
  var runtime = new $RuntimeOptions{};
  return getTransitRouterFlowTopNWithOptions(request, runtime);
}

model GetVbrFlowTopNRequest {
  accountIds?: [ long ](name='AccountIds', description='The IDs of member accounts.'),
  attachmentId?: string(name='AttachmentId', description='The CEN connection ID.', example='tr-attach-dnv870gmqzmb5u****'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239092000'),
  cenId?: string(name='CenId', description='The CEN instance ID.', example='cen-ia8kw1zjv4hyal****'),
  cloudIp?: string(name='CloudIp', description='The local IP address.', example='112.74.XX.XX'),
  cloudPort?: string(name='CloudPort', description='The local port.

>  This parameter is required only if you set **GroupBy** to **CloudPort**.', example='443'),
  direction?: string(name='Direction', description='The direction of the hybrid cloud traffic in the local regions or for the local IP addresses. Valid values:

*   **in**: traffic from a data center to Alibaba Cloud
*   **out**: traffic from Alibaba Cloud to a data center

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239093000'),
  groupBy?: string(name='GroupBy', description='The dimension for ranking hybrid cloud traffic data. The value of this parameter is case-sensitive. Valid values:

*   **1Tuple**: queries the rankings of hybrid cloud traffic data for the Cloud Enterprise Network (CEN) instances, CEN connections, virtual border routers (VBRs), and IP addresses.
*   **2Tuple**: queries the rankings of hybrid cloud traffic data for the local and remote IP addresses.
*   **5Tuple**: queries the rankings of hybrid cloud traffic data for the local and remote IP addresses, local and remote ports, and protocols.
*   **CloudPort**: queries the rankings of hybrid cloud traffic data for the local ports.
*   **OtherPort**: queries the rankings of hybrid cloud traffic data for the remote ports.
*   **Protocol**: queries the rankings of hybrid cloud traffic data for the protocols.

This parameter is required.', example='1Tuple'),
  orderBy?: string(name='OrderBy', description='The metric for ranking hybrid cloud traffic data. Default value: Bytes. This value specifies that hybrid cloud traffic data is ranked by traffic volumes.', example='Bytes'),
  otherIp?: string(name='OtherIp', description='The remote IP address.', example='122.112.XX.XX'),
  otherPort?: string(name='OtherPort', description='The remote port.

>  This parameter is required only if you set **GroupBy** to **OtherPort**.', example='40002'),
  protocol?: string(name='Protocol', description='The protocol number.

>  All protocols are supported. This parameter is required only if you set **GroupBy** to **5Tuple** or **Protocol**.', example='6'),
  regionId?: string(name='RegionId', description='The local region.

This parameter is required.', example='cn-shanghai'),
  sort?: string(name='Sort', description='The order for ranking hybrid cloud traffic data. Valid values:

*   **desc**: descending order
*   **asc**: ascending order', example='desc'),
  topN?: int32(name='TopN', description='Specifies top-N traffic data to display. Default value: **10**. This value specifies that top-10 traffic data is displayed by default. Maximum value: **100**.', example='10'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
  virtualBorderRouterId?: string(name='VirtualBorderRouterId', description='The ID of the VBR that is associated with the Express Connect circuit.', example='vbr-k1atj46citwuek42j****'),
}

model GetVbrFlowTopNShrinkRequest {
  accountIdsShrink?: string(name='AccountIds', description='The IDs of member accounts.'),
  attachmentId?: string(name='AttachmentId', description='The CEN connection ID.', example='tr-attach-dnv870gmqzmb5u****'),
  beginTime?: long(name='BeginTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239092000'),
  cenId?: string(name='CenId', description='The CEN instance ID.', example='cen-ia8kw1zjv4hyal****'),
  cloudIp?: string(name='CloudIp', description='The local IP address.', example='112.74.XX.XX'),
  cloudPort?: string(name='CloudPort', description='The local port.

>  This parameter is required only if you set **GroupBy** to **CloudPort**.', example='443'),
  direction?: string(name='Direction', description='The direction of the hybrid cloud traffic in the local regions or for the local IP addresses. Valid values:

*   **in**: traffic from a data center to Alibaba Cloud
*   **out**: traffic from Alibaba Cloud to a data center

This parameter is required.', example='in'),
  endTime?: long(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. The maximum time range that you can query is 24 hours.

This parameter is required.', example='1638239093000'),
  groupBy?: string(name='GroupBy', description='The dimension for ranking hybrid cloud traffic data. The value of this parameter is case-sensitive. Valid values:

*   **1Tuple**: queries the rankings of hybrid cloud traffic data for the Cloud Enterprise Network (CEN) instances, CEN connections, virtual border routers (VBRs), and IP addresses.
*   **2Tuple**: queries the rankings of hybrid cloud traffic data for the local and remote IP addresses.
*   **5Tuple**: queries the rankings of hybrid cloud traffic data for the local and remote IP addresses, local and remote ports, and protocols.
*   **CloudPort**: queries the rankings of hybrid cloud traffic data for the local ports.
*   **OtherPort**: queries the rankings of hybrid cloud traffic data for the remote ports.
*   **Protocol**: queries the rankings of hybrid cloud traffic data for the protocols.

This parameter is required.', example='1Tuple'),
  orderBy?: string(name='OrderBy', description='The metric for ranking hybrid cloud traffic data. Default value: Bytes. This value specifies that hybrid cloud traffic data is ranked by traffic volumes.', example='Bytes'),
  otherIp?: string(name='OtherIp', description='The remote IP address.', example='122.112.XX.XX'),
  otherPort?: string(name='OtherPort', description='The remote port.

>  This parameter is required only if you set **GroupBy** to **OtherPort**.', example='40002'),
  protocol?: string(name='Protocol', description='The protocol number.

>  All protocols are supported. This parameter is required only if you set **GroupBy** to **5Tuple** or **Protocol**.', example='6'),
  regionId?: string(name='RegionId', description='The local region.

This parameter is required.', example='cn-shanghai'),
  sort?: string(name='Sort', description='The order for ranking hybrid cloud traffic data. Valid values:

*   **desc**: descending order
*   **asc**: ascending order', example='desc'),
  topN?: int32(name='TopN', description='Specifies top-N traffic data to display. Default value: **10**. This value specifies that top-10 traffic data is displayed by default. Maximum value: **100**.', example='10'),
  useMultiAccount?: boolean(name='UseMultiAccount', description='Specifies whether to enable the multi-account management feature. Default value: **false**. This value specifies that the multi-account management feature is disabled.

>  By default, the multi-account management feature is not available. If you want to use this feature, contact your account manager to apply for permissions.', example='false'),
  virtualBorderRouterId?: string(name='VirtualBorderRouterId', description='The ID of the VBR that is associated with the Express Connect circuit.', example='vbr-k1atj46citwuek42j****'),
}

model GetVbrFlowTopNResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
  virtualBorderRouterFlowlogTopN?: [ 
    {
      accountId?: string(name='AccountId', description='The account ID.', example='156237031628****'),
      attachmentId?: string(name='AttachmentId', description='The CEN connection ID.', example='tr-attach-u6v1j3jre0fe9h****'),
      bytes?: double(name='Bytes', description='The total volume of traffic in the specified time range.', example='108'),
      cloudIp?: string(name='CloudIp', description='The local IP address.', example='120.24.X.X'),
      cloudPort?: string(name='CloudPort', description='The local port.', example='80'),
      cloudRegion?: string(name='CloudRegion', description='The local region where the local IP address resides.', example='cn-shanghai'),
      otherIp?: string(name='OtherIp', description='The remote IP address.', example='222.85.X.X'),
      otherPort?: string(name='OtherPort', description='The remote port.', example='10965'),
      packets?: double(name='Packets', description='The total number of packets in the specified time range.', example='66'),
      protocol?: string(name='Protocol', description='The protocol number.', example='6'),
      virtualBorderRouterId?: string(name='VirtualBorderRouterId', description='The ID of the VBR that is associated with the Express Connect circuit.', example='vbr-k1atj46citwuek42j****'),
    }
  ](name='VirtualBorderRouterFlowlogTopN', description='The ranking result of hybrid cloud traffic data.'),
}

model GetVbrFlowTopNResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVbrFlowTopNResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GetVbrFlowTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of hybrid cloud traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Hybrid cloud traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param tmpReq GetVbrFlowTopNRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVbrFlowTopNResponse
 */
// Deprecated
async function getVbrFlowTopNWithOptions(tmpReq: GetVbrFlowTopNRequest, runtime: $RuntimeOptions): GetVbrFlowTopNResponse {
  tmpReq.validate();
  var request = new GetVbrFlowTopNShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.accountIds)) {
    request.accountIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.accountIds, 'AccountIds', 'json');
  }
  var query = {};
  if (!$isNull(request.accountIdsShrink)) {
    query['AccountIds'] = request.accountIdsShrink;
  }
  if (!$isNull(request.attachmentId)) {
    query['AttachmentId'] = request.attachmentId;
  }
  if (!$isNull(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!$isNull(request.cenId)) {
    query['CenId'] = request.cenId;
  }
  if (!$isNull(request.cloudIp)) {
    query['CloudIp'] = request.cloudIp;
  }
  if (!$isNull(request.cloudPort)) {
    query['CloudPort'] = request.cloudPort;
  }
  if (!$isNull(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.otherIp)) {
    query['OtherIp'] = request.otherIp;
  }
  if (!$isNull(request.otherPort)) {
    query['OtherPort'] = request.otherPort;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!$isNull(request.topN)) {
    query['TopN'] = request.topN;
  }
  if (!$isNull(request.useMultiAccount)) {
    query['UseMultiAccount'] = request.useMultiAccount;
  }
  if (!$isNull(request.virtualBorderRouterId)) {
    query['VirtualBorderRouterId'] = request.virtualBorderRouterId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVbrFlowTopN',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GetVbrFlowTopN is deprecated, please use nis::2021-12-16::GetNisNetworkRanking instead.
 *
 * @summary Queries the rankings of hybrid cloud traffic data in the form of 1-tuple, 2-tuple, or 5-tuple. Hybrid cloud traffic data can be ranked by metrics such as traffic volumes and the number of packets.
 *
 * @param request GetVbrFlowTopNRequest
 * @return GetVbrFlowTopNResponse
 */
// Deprecated
async function getVbrFlowTopN(request: GetVbrFlowTopNRequest): GetVbrFlowTopNResponse {
  var runtime = new $RuntimeOptions{};
  return getVbrFlowTopNWithOptions(request, runtime);
}

model ListNisInspectionResourceTypeResponseBody = {
  requestId?: string(name='RequestId', example='D5E98683-355B-5867-8D3D-A24755F6895B'),
  resourceTypeList?: [ 
    {
      resourceType?: string(name='ResourceType', example='EIP'),
    }
  ](name='ResourceTypeList'),
}

model ListNisInspectionResourceTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNisInspectionResourceTypeResponseBody(name='body'),
}

/**
 * @summary 巡检资源类型列表
 *
 * @param request ListNisInspectionResourceTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNisInspectionResourceTypeResponse
 */
async function listNisInspectionResourceTypeWithOptions(runtime: $RuntimeOptions): ListNisInspectionResourceTypeResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListNisInspectionResourceType',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 巡检资源类型列表
 *
 * @return ListNisInspectionResourceTypeResponse
 */
async function listNisInspectionResourceType(): ListNisInspectionResourceTypeResponse {
  var runtime = new $RuntimeOptions{};
  return listNisInspectionResourceTypeWithOptions(runtime);
}

model ListNisInspectionTaskReportsRequest {
  inspectionTaskId?: string(name='InspectionTaskId', description='This parameter is required.', example='ni-8svmpe0yso2bhzr7fh79'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml194Cz/lMNdmr+DEh0th6dVlNEo/F148UPCh2itDku7Qj'),
}

model ListNisInspectionTaskReportsResponseBody = {
  inspectionReportList?: [ 
    {
      inspectionReportId?: string(name='InspectionReportId', example='nir-7c3dd178738a429abe6d'),
    }
  ](name='InspectionReportList'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml194Cz/lMNdmr+DEh0th6dVlNEo/F148UPCh2itDku7Qj'),
  requestId?: string(name='RequestId', example='0D213AF9-7B8A-51A8-B411-2D797A1A447B'),
  totalCount?: int32(name='TotalCount', example='34'),
}

model ListNisInspectionTaskReportsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNisInspectionTaskReportsResponseBody(name='body'),
}

/**
 * @summary 查询巡检报告列表
 *
 * @param request ListNisInspectionTaskReportsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNisInspectionTaskReportsResponse
 */
async function listNisInspectionTaskReportsWithOptions(request: ListNisInspectionTaskReportsRequest, runtime: $RuntimeOptions): ListNisInspectionTaskReportsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListNisInspectionTaskReports',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询巡检报告列表
 *
 * @param request ListNisInspectionTaskReportsRequest
 * @return ListNisInspectionTaskReportsResponse
 */
async function listNisInspectionTaskReports(request: ListNisInspectionTaskReportsRequest): ListNisInspectionTaskReportsResponse {
  var runtime = new $RuntimeOptions{};
  return listNisInspectionTaskReportsWithOptions(request, runtime);
}

model ListNisInspectionTasksRequest {
  inspectionName?: string(name='InspectionName'),
  inspectionProject?: string(name='InspectionProject', example='basic'),
  inspectionTaskId?: string(name='InspectionTaskId', example='ni-8svm******hzr7fh79'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml1/R9jhHkiH8eW3CfaOYU0CEL7yiT0zae6J8v1zYNg+d1'),
  status?: string(name='Status', example='Active'),
}

model ListNisInspectionTasksResponseBody = {
  inspectionTaskList?: [ 
    {
      createTime?: string(name='CreateTime', example='2024-06-18 00:14:46'),
      inspectionName?: string(name='InspectionName'),
      inspectionProject?: string(name='InspectionProject', example='basic'),
      inspectionTaskId?: string(name='InspectionTaskId', example='ni-8svm******hzr7fh79'),
      lastUpdateReportId?: string(name='LastUpdateReportId', example='nir-b4c4c9******8a25e'),
      status?: string(name='Status', example='Active'),
    }
  ](name='InspectionTaskList'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='hKrS+MVXkuOgztXnvdml194Cz/lMNdmr+DEh0th6dVlNEo/F148UPCh2itDku7Qj'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
  totalCount?: int32(name='TotalCount', example='5'),
}

model ListNisInspectionTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNisInspectionTasksResponseBody(name='body'),
}

/**
 * @summary 巡检任务列表
 *
 * @param request ListNisInspectionTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNisInspectionTasksResponse
 */
async function listNisInspectionTasksWithOptions(request: ListNisInspectionTasksRequest, runtime: $RuntimeOptions): ListNisInspectionTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionName)) {
    query['InspectionName'] = request.inspectionName;
  }
  if (!$isNull(request.inspectionProject)) {
    query['InspectionProject'] = request.inspectionProject;
  }
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListNisInspectionTasks',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 巡检任务列表
 *
 * @param request ListNisInspectionTasksRequest
 * @return ListNisInspectionTasksResponse
 */
async function listNisInspectionTasks(request: ListNisInspectionTasksRequest): ListNisInspectionTasksResponse {
  var runtime = new $RuntimeOptions{};
  return listNisInspectionTasksWithOptions(request, runtime);
}

model StartNisInspectionTaskRequest {
  inspectionTaskId?: string(name='InspectionTaskId', description='This parameter is required.', example='ni-8svmpe0yso****r7fh79'),
}

model StartNisInspectionTaskResponseBody = {
  inspectionReportId?: string(name='InspectionReportId', example='nir-9923e262c106461d86ad'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
}

model StartNisInspectionTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartNisInspectionTaskResponseBody(name='body'),
}

/**
 * @summary 请补充描述开启任务
 *
 * @param request StartNisInspectionTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartNisInspectionTaskResponse
 */
async function startNisInspectionTaskWithOptions(request: StartNisInspectionTaskRequest, runtime: $RuntimeOptions): StartNisInspectionTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartNisInspectionTask',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 请补充描述开启任务
 *
 * @param request StartNisInspectionTaskRequest
 * @return StartNisInspectionTaskResponse
 */
async function startNisInspectionTask(request: StartNisInspectionTaskRequest): StartNisInspectionTaskResponse {
  var runtime = new $RuntimeOptions{};
  return startNisInspectionTaskWithOptions(request, runtime);
}

model UpdateNisInspectionTaskRequest {
  inspectionTaskId?: string(name='InspectionTaskId', description='This parameter is required.', example='ni-8svmpe0yso2bhzr7fh79'),
  status?: string(name='Status', example='Active'),
}

model UpdateNisInspectionTaskResponseBody = {
  data?: boolean(name='Data', example='True'),
  requestId?: string(name='RequestId', example='A7F0D6EC-E19E-58AC-AC9F-08036763960F'),
}

model UpdateNisInspectionTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateNisInspectionTaskResponseBody(name='body'),
}

/**
 * @summary 修改巡检项
 *
 * @param request UpdateNisInspectionTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateNisInspectionTaskResponse
 */
async function updateNisInspectionTaskWithOptions(request: UpdateNisInspectionTaskRequest, runtime: $RuntimeOptions): UpdateNisInspectionTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.inspectionTaskId)) {
    query['InspectionTaskId'] = request.inspectionTaskId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateNisInspectionTask',
    version = '2021-12-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改巡检项
 *
 * @param request UpdateNisInspectionTaskRequest
 * @return UpdateNisInspectionTaskResponse
 */
async function updateNisInspectionTask(request: UpdateNisInspectionTaskRequest): UpdateNisInspectionTaskResponse {
  var runtime = new $RuntimeOptions{};
  return updateNisInspectionTaskWithOptions(request, runtime);
}

